package com.demo.transactional.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.demo.mybatis.service.MLoginRegisterService;

@RestController
@RequestMapping("/transactional")
public class TransactionalController {
	@Autowired
	private MLoginRegisterService mLoginRegisterService;
	@RequestMapping("/test")
	public Map<String, Object> testTransational(Long id,HttpSession session) {
		Map<String, Object> map = new HashMap<>();
		session.setAttribute("test", "哈喽");
		int delete = mLoginRegisterService.delete(id);
		map.put("result", delete);
		return map;
	}
}
